package com.dwb.controller;

import com.dwb.result.Result;
import com.dwb.service.PNewsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author wx
 * @create 2020/6/28 11:48
 */
@Api(value = "PNewsController", description = "新闻资讯控制器")
@RestController
@RequestMapping("/PNewsController")
public class PNewsController {
    @Autowired
    private PNewsService sNewsService;

    /**
     * 获取新闻资讯详情信息
     * @param parameters
     * @return
     */
    @ApiOperation(value = "getInfo",notes = "获取新闻资讯详情信息")
    @PostMapping("/getInfo")
    public Result<Map<String ,Object>> getInfo(@RequestBody Map<String,String> parameters){
        Result<Map<String ,Object>> result = Result.newSuccess();
        Map<String,Object> map = sNewsService.getInfo(parameters);
        result.setDataMap(map);
        return result;
    }


}
